package com.cn.stepLock.chain;

import com.cn.stepLock.lambda.LambdaUtil;
import com.google.common.collect.ImmutableList;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.LockSupport;

import static com.cn.stepLock.lambda.LambdaUtil.transferDistinctList;

/**
 * @author Aaron
 * @desc
 * @createTime 2022-02-24 3:14
 * @since
 */
public class TailChain extends ConstentChain implements Chain {

    @Override
    public void executeTask(Task task) {
        //removeTask(task);
//        if (!task.unparkPresentTask) {
//            //removePreChainTask(task);
//            return;
//        }
        //List<Task> presentTaskList = getPresentTaskList(task);
        Task executeTask = task;
        while (executeTask!=null){
            executeTask.finaleFinished=true;
            executeTask = executeTask.preChainTask;
        }

//        task.finaleFinished=true;
//        presentTaskList.forEach(x->x.finaleFinished=true);
        //unparkPresentThreadList(task, presentTaskList);
    }



}
